<template>
    <el-menu default-active="'/home'" :collapse="true" class="sideBar" router>

        <el-icon class="logo">
            GTenACGN
        </el-icon>

        <el-menu-item class="m-item" index="/home">
            <el-icon class="tab">首页</el-icon>
        </el-menu-item>

        <el-menu-item class="m-item" index="2">
            <el-icon class="tab">论坛社区</el-icon>
        </el-menu-item>
        <el-menu-item class="m-item" index="/cartoon">
            <el-icon class="tab">漫画</el-icon>
        </el-menu-item>
        <el-menu-item class="m-item" index="/novel">
            <el-icon class="tab">轻小说</el-icon>
        </el-menu-item>
        <el-menu-item class="m-item" index="/tool">
            <el-icon class="tab">工具</el-icon>
        </el-menu-item>


        <li style="flex-grow: 0.99;-webkit-app-region: drag;"></li>


        <el-sub-menu class="m-sub" index="/setting">
            <template #title>
                <el-icon class="tab" style="margin: 20px;width: 30px;" size="30px"><Setting /></el-icon>
            </template>

            <el-menu-item @click="restart">重启应用</el-menu-item>
            <el-menu-item index="/setting">全部设置</el-menu-item>

        </el-sub-menu>


    </el-menu>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router';

const router = useRouter()

const restart = function () {
    window.electronApi.restart()
}

</script>

<style scoped>
.sideBar {
    background-color: #f9f9f9;
    height: 100%;
    width: 120px;
    padding-left: 2px;
    padding-top: 5px;
    /* border: none; */
    display: flex;
    flex-direction: column;
    z-index: 2;
    /* box-shadow: var(--el-box-shadow-lighter); */
}

.logo {
    width: 110px;
    height: 65px;
    line-height: 65px;
    text-align: center;
    padding: 0;
    margin: 3px;
    /* user-select: none; */
    -webkit-app-region: drag;
    font-size: 18px;
    margin-bottom: 5px;
}


.m-item {
    margin: 3px;
    border-radius: 10px;
    text-align: center;
    justify-content: center;
}

.tab {
    font-style: normal;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    user-select: none;
}

.m-sub {
    display: flex;
    justify-content: center;
}
.m-sub * {
    margin: 3px;
    border-radius: 10px;
}
</style>